Update to work with Zingtree API v1#10
Draft
dtf0 wants to merge 4 commits into
Draft
Conversation
Added: - ZingtreeClient over urllib, with response capture and error handling - Agent dataclass and validating zingers.txt parser - Lookup tables (MAIN_ITEMS, SUBMENUS, OPERATIONS) for dispatch - Type hints and KeyboardInterrupt handling Changed: - Menu navigation is now a while loop, not recursion - URL path segments are percent-encoded - zingers.txt is read only when an operation needs it - Token check handles a missing variable Removed: - pycurl (now stdlib urllib); dotenv import optional - Duplicate exit helpers, dead branches, sleep delays
Added: - get_tree_variables, tree_sessions_last_clicked, delete_file_upload, session_freeze, vault_files (get/delete), with a new files menu - PUT/DELETE and JSON body support in ZingtreeClient.call Changed: - Base URL to /api/v1/ - Auth to X-Api-Key header; token removed from all paths - Path encoding keeps ^ literal for search_trees ^^ queries Removed: - get_trees (no longer in the API) - Token-masking logic (token no longer in the URL)
Resolves dropbox#9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align zinger with Zingtree API v1
Refactors the CLI and updates it to the v1 API surface, with a matching README.
Script
python-dotenvnow optional. Added aZingtreeClientwith response capture, GET/PUT/DELETE and JSON-body support, and HTTP/network error handling.Added an
Agentdataclass and a validatingzingers.txtparser; type hints andKeyboardInterrupthandling.API v1 alignment
/api/v1/; authentication moved to theX-Api-Keyheader (token no longer in the path).get_trees(no longer available according to docs). Addedget_tree_variables,tree_sessions_last_clicked,delete_file_upload,session_freeze, andvault_files(get/delete).^literal forsearch_trees^^queries.README
*), date defaults, header auth, and the production000suffix updated to match v1.Unverified
session_freezeproject_id-to-tree-ID mapping needs confirmation./api/v2/health)/api/v2/call_history/{{sessionId}})/api/v2/call_history)